<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
//use think\Route;
Route::get('/','manage/login/index');//后台登录页面

//后台路由
Route::group('manage', function(){
    Route::get('login','manage/login/index');//后台登录页面   
    // Route::get('verify','manage/login/verify');//获取验证码
    Route::post('checkLogin','manage/login/checkLogin');//登录验证
    Route::get('login/logout','manage/login/logout');//退出登录
    Route::post('ajax_select','manage/system/ajax_select');//获取角色
    Route::post('ajaxType','manage/Student/ajaxType');//获取角色
    Route::get("addEntry/id/:id",'manage/Student/addEntry');//添加缴费页面
    Route::get("supplement/id/:id",'manage/Charge/supplement');//补交缴费页面
    
});

//后台路由中间件
Route::group('manage', function(){
    Route::get('/','manage/home/index');//首页
    Route::get('home','manage/home/index');//首页
    Route::get('welcome','manage/home/welcome');//欢迎页
    Route::post('cache','manage/home/webCache');//清除缓存
    
    // +----------------------------------------------------------------------
    // | 系统管理
    // +----------------------------------------------------------------------
    Route::post('editPosition','manage/system/editPosition');//添加职务
    Route::get('getCompany','manage/system/getCompany');//获取公司列表
    Route::get('companyDetail','manage/system/companyDetail');//获取公司
    Route::post('editCompany','manage/system/editCompany');//修改公司
    Route::get('getPosition','manage/system/getPosition');//根据公司获取职位
    Route::get("role",'manage/system/role');//角色列表
    Route::get("company",'manage/system/companyList');//公司列表
    Route::rule("roleEdit/[:pid]/[:id]",'manage/system/role_details');//编辑
    Route::get("account",'manage/system/system_account');//管理账号
    Route::post("editAccount",'manage/system/save_account');//编辑
    Route::post("account_status",'manage/system/account_status');//账号状态
    Route::post("delAccount",'manage/system/acc_delete');//删除账号
    Route::rule("operationLog",'manage/system/log');//操作记录
    Route::rule("menu",'manage/system/menu');//菜单
    Route::post("system/menu_type",'manage/system/menuType');//菜单状态
    Route::get("meunDel/pid/:id",'manage/system/meunDel')->pattern(['id'=>'\d+']);//菜单删除
    Route::post("menuSort",'manage/system/menuSort');//菜单排序
    Route::post("add_menu",'manage/system/addMenu');//添加菜单
    Route::rule("menu_edit/:pid/:id",'manage/system/menuEdit');//编辑菜单
    Route::post("maintain",'manage/system/maintain');//网站维护
    // +----------------------------------------------------------------------
    // | 学员数据录入
    // +----------------------------------------------------------------------
    
    Route::post("addCost",'manage/Charge/addCost');//添加缴费处理
    Route::post('ajaxSupplement','manage/Charge/ajaxSupplement');//补交学费处理
    Route::rule("listCost",'manage/Charge/list');//缴费列表
    Route::rule("listStudent",'manage/Student/studentMaterial');//学员列表
    Route::post("addStudentMaterial",'manage/Student/ajaxAddStudent');//添加学员资料
    Route::post("audit",'manage/Charge/ajaxAudit');//总公司审核
    Route::post("totalAudit",'manage/Charge/ajaxtotalAudit');//分公司审核
    // +----------------------------------------------------------------------
    // | 数据统计
    // +----------------------------------------------------------------------
  
    Route::get("salesmanincomeStatisticList",'manage/statistics/salesmanincomeStatisticList');//业务员收入统计
    // +----------------------------------------------------------------------
  

})->middleware("Manage");



Route::group('api', function(){
    Route::post("feedback",'api/ApiController/feedback');
});